]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
extensions-app: Use banner instead of action bar
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 7 Dec 2023 18:10:40 +0000 (19:10 +0100)
committerMarge Bot <marge-bot@gnome.org>
Mon, 11 Dec 2023 14:24:01 +0000 (14:24 +0000)
Action bars have largely gone out of fashion, and Banner is an
appropriate replacement in our case, so switch to that.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3048>

subprojects/extensions-app/data/ui/extensions-window.ui
subprojects/extensions-app/js/main.js

index 336149a1feb06a6c988b20937bf92c55caa21231..ac682f044408f7ad515317e2bbc9230a593d3fbf 100644 (file)
               <object class="GtkStackPage">
                 <property name="name">main</property>
                 <property name="child">
-                  <object class="AdwPreferencesPage">
+                  <object class="GtkBox">
+                    <property name="orientation">vertical</property>
                     <child>
-                      <object class="AdwPreferencesGroup">
+                      <object class="AdwBanner" id="updatesBanner">
+                        <property name="button-label" translatable="yes">Log Out…</property>
+                        <property name="action-name">win.logout</property>
+                      </object>
+                    </child>
+                    <child>
+                      <object class="AdwPreferencesPage">
                         <child>
-                          <object class="AdwActionRow">
-                            <property name="title" translatable="yes">Extensions</property>
-                            <property name="subtitle" translatable="yes">Extensions can cause performance and stability issues. Disable extensions if you encounter problems with your system.</property>
-                            <property name="activatable-widget">enabledSwitch</property>
+                          <object class="AdwPreferencesGroup">
                             <child>
-                              <object class="GtkSwitch" id="enabledSwitch">
-                                <property name="action-name">win.user-extensions-enabled</property>
-                                <property name="valign">center</property>
+                              <object class="AdwActionRow">
+                                <property name="title" translatable="yes">Extensions</property>
+                                <property name="subtitle" translatable="yes">Extensions can cause performance and stability issues. Disable extensions if you encounter problems with your system.</property>
+                                <property name="activatable-widget">enabledSwitch</property>
+                                <child>
+                                  <object class="GtkSwitch" id="enabledSwitch">
+                                    <property name="action-name">win.user-extensions-enabled</property>
+                                    <property name="valign">center</property>
+                                  </object>
+                                </child>
                               </object>
                             </child>
                           </object>
                         </child>
-                      </object>
-                    </child>
-                    <child>
-                      <object class="AdwPreferencesGroup" id="userGroup">
-                        <property name="title" translatable="yes">Manually Installed</property>
-                        <property name="description" translatable="yes">To find and add extensions, visit &lt;a href="https://extensions.gnome.org"&gt;extensions.gnome.org&lt;/a&gt;.</property>
                         <child>
-                          <object class="GtkListBox" id="userList">
-                            <property name="selection-mode">none</property>
-                            <style>
-                              <class name="boxed-list"/>
-                            </style>
+                          <object class="AdwPreferencesGroup" id="userGroup">
+                            <property name="title" translatable="yes">Manually Installed</property>
+                            <property name="description" translatable="yes">To find and add extensions, visit &lt;a href="https://extensions.gnome.org"&gt;extensions.gnome.org&lt;/a&gt;.</property>
+                            <child>
+                              <object class="GtkListBox" id="userList">
+                                <property name="selection-mode">none</property>
+                                <style>
+                                  <class name="boxed-list"/>
+                                </style>
+                              </object>
+                            </child>
                           </object>
                         </child>
-                      </object>
-                    </child>
-                    <child>
-                      <object class="AdwPreferencesGroup" id="systemGroup">
-                        <property name="title" translatable="yes">Built-In</property>
                         <child>
-                          <object class="GtkListBox" id="systemList">
-                            <property name="selection-mode">none</property>
-                            <style>
-                              <class name="boxed-list"/>
-                            </style>
+                          <object class="AdwPreferencesGroup" id="systemGroup">
+                            <property name="title" translatable="yes">Built-In</property>
+                            <child>
+                              <object class="GtkListBox" id="systemList">
+                                <property name="selection-mode">none</property>
+                                <style>
+                                  <class name="boxed-list"/>
+                                </style>
+                              </object>
+                            </child>
                           </object>
                         </child>
                       </object>
             </child>
           </object>
         </property>
-        <child type="bottom">
-          <object class="GtkActionBar" id="updatesBar">
-            <property name="revealed">False</property>
-            <child>
-              <object class="GtkImage">
-                <property name="pixel-size">24</property>
-                <property name="margin-start">6</property>
-                <property name="margin-end">6</property>
-                <property name="margin-top">6</property>
-                <property name="margin-bottom">6</property>
-                <property name="icon-name">software-update-available-symbolic</property>
-                <style>
-                  <class name="warning"/>
-                </style>
-              </object>
-            </child>
-            <child>
-              <object class="GtkBox">
-                <property name="orientation">vertical</property>
-                <property name="valign">center</property>
-                <child>
-                  <object class="GtkLabel">
-                    <property name="halign">start</property>
-                    <property name="label" translatable="yes">Extension Updates Ready</property>
-                    <style>
-                      <class name="heading"/>
-                    </style>
-                  </object>
-                </child>
-                <child>
-                  <object class="GtkLabel" id="updatesLabel">
-                    <property name="halign">start</property>
-                  </object>
-                </child>
-              </object>
-            </child>
-            <child type="end">
-              <object class="GtkButton">
-                <property name="label" translatable="yes">Log Out…</property>
-                <property name="valign">center</property>
-                <property name="action-name">win.logout</property>
-                <property name="receives-default">True</property>
-                <style>
-                  <class name="suggested-action"/>
-                </style>
-              </object>
-            </child>
-          </object>
-        </child>
       </object>
     </child>
   </template>
index 0853a89300134eacda818ceb3fe87494fd6074d6..529db5c547af01f3f674f3b7026b71fc45c0f579 100644 (file)
@@ -88,8 +88,7 @@ var ExtensionsWindow = GObject.registerClass({
         'searchBar',
         'searchButton',
         'searchEntry',
-        'updatesBar',
-        'updatesLabel',
+        'updatesBanner',
     ],
 }, class ExtensionsWindow extends Adw.ApplicationWindow {
     _init(params) {
@@ -341,11 +340,11 @@ var ExtensionsWindow = GObject.registerClass({
     _checkUpdates() {
         let nUpdates = [...this._userList].filter(c => c.hasUpdate).length;
 
-        this._updatesLabel.label = Gettext.ngettext(
+        this._updatesBanner.title = Gettext.ngettext(
             '%d extension will be updated on next login.',
             '%d extensions will be updated on next login.',
             nUpdates).format(nUpdates);
-        this._updatesBar.revealed = nUpdates > 0;
+        this._updatesBanner.revealed = nUpdates > 0;
     }
 
     _extensionsLoaded() {